<?php 
/**
 * **模型
 * @author 后盾马震宇 <houdunwangmzy@163.com>
 */
class OrderListModel extends Model{
    public $table = 'order_list';
    
    public $auto = array();
    
    public $validate = array();
    
	
	/**
	 * 添加订单列表
	 */
	public function addData($oid){
		if(!$this->create()) return FALSE;
		$cart = $_SESSION['cart'];
		foreach ($cart['goods'] as $k => $v) {
			$data = array(
				'spec' => $v['options']['specName'],
				'price' => $v['price'],
				'quantity' => $v['num'],
				'subtotal' => $v['total'],
				'goods_gid' => $v['id'],
				'order_oid' => $oid
			);
			$this->add($data);
		}
		return TRUE;
	}
	
	
    
 }
 
 
 
 
 
 
 
 
 
 
 



 ?>